<?php
declare (strict_types = 1);

namespace app\validate;

use think\Validate;

class BankValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule =   [
        'credit_card_numbers'   => 'require|max:19|unique:user_bank,credit_card_numbers',
        'identity_card' => 'require|length:18',
        'name' => 'require',
    ];

    protected $message  =   [
        'credit_card_numbers.require'   => '银行卡号必须',
        'credit_card_numbers.max'   => '银行卡号最多19位',
        'credit_card_numbers.unique'   => '银行卡已经绑定过了',
        'identity_card.require' => '身份证号必须填写',
        'identity_card.length' => '身份证号必须18位',
        'name' => '必须填写',
    ];
}
